@import "../../editor/stylesheets/variables.less";

body {
  overflow: auto;
}

// Logo position overrides
.navbar-thimble {
  background: #2d9961;
  position: relative;

  .navbar-logo-container.small-logo {
    top: 2px;
    left: -9px;
  }
}

.project-list-wrapper {
  width: ~"calc(100% - 100px)";
  margin: 50px auto;
  position: relative;
  max-width: 1024px;
}

h2 {
  font-weight: 600;
  font-size: 1.4em;
  padding: 3px 0 0 4px;
  margin: 0 0 30px;
}

.shared-button-styles {
  cursor: pointer;
  color: white;
  border-bottom: solid 2px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  padding: 8px 15px;
  position: relative;
  float: right;

  &:hover {
    opacity: 0.9;
  }

  &:active {
    margin-top: 2px;
    border: none;
    opacity: 0.5;
  }

  &.disabled {
    color: rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: solid 2px transparent !important;
    cursor: progress;
  }
}

.project-button {
  background-color: @buttonGreen;

  .shared-button-styles;
}

.delete-button {

  .shared-button-styles;

  background-color: @red;
  display: none;
  margin-right: 10px;
  padding-left: 36px;

  img {
    height: 19px;
    position: absolute;
    top: 9px;
    left: 12px;
  }
}

#project-list {
  width: 100%;
  margin-bottom: 25px;
  position: relative;
  transition: opacity 0.15s ease-out;
  opacity: 0;

  &.loaded {
    opacity: 1;
  }

  .project {
    border-bottom: 1px solid #ddd;
    position: relative;
    padding: 0 10px 0 36px;
    display: flex;

    &:last-child {
      border: none;
    }

    &:hover {
      background: rgba(0, 0, 0, 0.04);
    }
  }

  .edit-link {
    flex: 1;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    display: block;
    font-weight: 600;
    padding: 10px 20px 10px 0;
    min-width: 0;
  }

  .pending-delete {
    background: rgba(255, 0, 0, 0.08);

    &:hover {
      background: rgba(255, 0, 0, 0.1);
    }
  }

  .project-ui {
    flex-shrink: 1;
    white-space: nowrap;
    text-align: right;
    padding-top: 10px;
  }

  .published-link {
    text-decoration: none;
    color: #3186c1;
    display: inline-block;

    &:hover {
      text-decoration: underline;
    }

    @media screen and (max-width: 800px) {
      display: block;
    }
  }

  .remix-link {
    text-decoration: none;
    color: #3186c1;
    display: inline-block;
    margin-left: 10px;

    &:hover {
      text-decoration: underline;
    }

    @media screen and (max-width: 800px) {
      display: block;
    }
  }

  .disabled-link {
    cursor: default;
    pointer-events: none;

    &:hover {
      text-decoration: none;
    }
  }

  .project-information {
    font-size: 0.8em;
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
    white-space: nowrap;
    font-weight: 400;
  }

  .project-description {
    font-size: 0.9em;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 400;

    &:empty {
      display: none;
    }
  }

  .project-delete,
  .project-delete-cancel {
    color: black;
    margin-left: 12px;
    opacity: 0.3;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
  }

  .project-delete.hide,
  .project-delete-cancel.hide {
    display: none;
  }

  .icon-garbage-can {
    width: 15px;
    height: 18px;
    position: relative;
    top: 3px;
    display: inline-block;
    background-image: url(/img/icon/garbage-can-bottom.svg);
    background-repeat: no-repeat;
    background-size: 15px;
    background-position: bottom;
    transform: scale(0.95);

    &::after {
      content: "";
      width: 15px;
      height: 6px;
      position: absolute;
      top: 0;
      left: 0;
      background-image: url(/img/icon/garbage-can-top.svg);
      background-repeat: no-repeat;
      background-size: 17px;
      background-position: top;
      transition: transform 0.1s ease-out;
    }
  }

  .project-delete:hover,
  .project-delete-cancel:hover {
    opacity: 0.6;
  }

  .project-delete:hover ::after,
  .project-delete-cancel:hover ::after {
    transform-origin: left;
    transform: rotate(-4deg) translateY(-1px);
  }

  .project-favorite-button {
    width: 31px;
    height: 31px;
    position: absolute;
    top: 4px;
    left: 3px;
    background-image: url(/img/icon/star-off.svg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 20px;
    opacity: 0.6;
    display: block;
    cursor: pointer;

    &:hover {
      opacity: 1;
    }
  }

  .project-favorite-selected {
    background-image: url(/img/icon/star-on.svg);
    opacity: 1;
    animation: starpop 0.3s ease-out;
  }

  @keyframes starpop {
    0% {
      transform: scale(0.6) rotate(0);
    }

    40% {
      transform: scale(1.2);
    }
  }
}
